package com.example.computer_exam_training_sys.controller;

import com.example.computer_exam_training_sys.service.FeedbackVOService;
import com.example.computer_exam_training_sys.vo.FeedbackDetailVO;
import com.example.computer_exam_training_sys.vo.FeedbackListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/feedback-vo")
@CrossOrigin
public class FeedbackVOController {
    @Autowired
    private FeedbackVOService feedbackVOService;

    // 反馈列表
    @GetMapping("/list")
    public List<FeedbackListVO> getFeedbackList() {
        return feedbackVOService.getFeedbackList();
    }

    // 反馈详情
    @GetMapping("/detail/{feedbackId}")
    public FeedbackDetailVO getFeedbackDetail(@PathVariable Integer feedbackId) {
        return feedbackVOService.getFeedbackDetail(feedbackId);
    }

    // 根据用户id查询反馈列表
    @GetMapping("/list/byuser/{userId}")
    public List<FeedbackListVO> getFeedbackListByUserId(@PathVariable Integer userId) {
        return feedbackVOService.getFeedbackListByUserId(userId);
    }
}
